<include file="Public/min-header" />
<div class="wrapper">

    <include file="Public/breadcrumb" />

    <section class="content">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="{:U('Admin/Wechat/addText')}">
                    <button type="button" class="btn btn-info">
                        <i class="ace-icon fa fa-plus bigger-110"></i>
                    </button>
                </a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 文本回复</h3>
                </div>
                <div class="panel-body">
                    <div id="ajax_return">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th width = "6%" style="width: 1px;" class="text-center">
                                            <input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);">
                                        </th>
                                        <th class="text-center">
                                            关键词
                                        </th>
                                        <th class="text-center">
                                            回答
                                        </th>
                                        <th width = "10%" class="text-center">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <volist name="lists" id="list">
                                        <tr>
                                            <td class="text-center">
                                                <input type="checkbox" name="selected[]" value="{$list.id}">
                                            </td>
                                            <td class="text-left">{$list.keyword}</td>
                                            <td class="text-left">{$list.text}</td>
                                            <td class="text-left">
                                                <a href="{:U('Admin/Wechat/addText',array('id'=>$list['id'],'edit'=>1))}" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="编辑"><i class="fa fa-pencil"></i></a>
                                                <a href="javascript:;" data-href="{:U('Admin/Wechat/delText',array('id'=>$list['id']))}" onclick="del('{$list[id]}', this)" id="button-delete6" data-toggle="tooltip" title="" class="btn btn-danger" data-original-title="删除"><i class="fa fa-trash-o"></i></a>
                                            </td>
                                        </tr>
                                    </volist>
                                </tbody>
                            </table>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
// 删除操作
function del(id, t) {
    if (!confirm('确定要删除吗?'))
        return false;

    location.href = $(t).data('href');
}
</script>
</body>

</html>
